package com.wbp.cms.qatest.dao;

import java.util.List;

import javax.annotation.Resource;

import org.junit.Test;

import com.wbp.cms.client.project.domain.ProjectWorkOrderDO;
import com.wbp.cms.client.project.query.ProjectWorkOrderQuery;
import com.wbp.cms.core.project.dao.ProjectWorkOrderDAO;
import com.wbp.cms.qatest.BaseTest;


/**
 * @Description: 
 * @Department:
 * @author andy.lhc
 * @date 2016年3月11日 下午11:54:56 
 */
public class ProjectWorkOrderDAOTest extends BaseTest {

  @Resource(name="projectWorkOrderDAO")
  private ProjectWorkOrderDAO   projectWorkOrderDAO ;

  @Test
  public void  test_insert01(){
    ProjectWorkOrderDO pj = new ProjectWorkOrderDO();
    pj.setComments("test1");
    pj.setName("合同已申请");
    pj.setProjectId(1L);
    pj.setStatus(1);
    
   System.out.println( this.projectWorkOrderDAO.insert(pj) > 0 ) ;
  }

  @Test
  public void  test_insert02(){
    ProjectWorkOrderDO pj = new ProjectWorkOrderDO();
    pj.setComments("test2");
    pj.setName("合同已寄出");
    pj.setProjectId(1L);
    pj.setStatus(2);
    
   System.out.println( this.projectWorkOrderDAO.insert(pj) > 0 ) ;
  }
  
  @Test
  public void test_query01(){
    ProjectWorkOrderQuery  p = new ProjectWorkOrderQuery();
    p.setProjectId(1L);
    List<ProjectWorkOrderDO>  list= this.projectWorkOrderDAO.query(p) ;
    System.out.println("size: " +list.size());
    System.out.println("list: " + list);
  }
  
  @Test
  public void test_load(){
    ProjectWorkOrderDO p = this.projectWorkOrderDAO.load(1L) ;
    System.out.println(p);
  }
}
